package com.szxx.suit.bomb;

import com.szxx.suit.AbstractAnalysisResult;
import com.szxx.suit.GdyAnalysisResult;

/**
 * 斗地主分析结果 <br>
 *
 * @author Ambrose
 */
public class BombAnalysisResult extends GdyAnalysisResult {
	
	@Override
	protected int doCompareTo(AbstractAnalysisResult compareTo) {
		if (compareTo == null) {
			return 1;
		} else {
			int cardNum = getCardNum() - ((GdyAnalysisResult)compareTo).getCardNum();
			if (cardNum == 0) {
				if (isAllCardLazi()) {
					return 1;
				} else if (((GdyAnalysisResult)compareTo).isAllCardLazi()) {
					return -1;
				} else {
					return getWeight() - ((GdyAnalysisResult)compareTo).getWeight();
				}
			} else {
				return cardNum; // 超级炸弹比数量，数量多的大
			}
		}
	}
	
	@Override
	public String toString() {
		return "SuperBombAnalysisResult [type=" + getType() + ", weight=" + getWeight() + ", len=" + getCardNum() + "]";
	}
	
}
